# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=web-soul
pkgver=2
pkgrel=8
groups=('blackarch' 'blackarch-webapp')
pkgdesc='A plugin based scanner for attacking and data mining web sites written in Perl.'
arch=('any')
url='http://packetstormsecurity.com/files/122064/Web-Soul-2-Scanner.html'
license=('custom:unknown')
depends=('perl')
source=("https://dl.packetstormsecurity.net/UNIX/scanners/web-soul-$pkgver.zip")
sha512sums=('f48fa6ed4a34420269d6f1aa239194ff3ca904a6ed0938cee8cbf8f4cf9529fd1fa8d272084a63f211449887d64bfd84763bcaf43150feb61a61e46418cbfca6')

prepare() {
  cd $pkgname

  sed -i "s|system('title WEB SOUL');||g" "$pkgname.pl"
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec perl $pkgname.pl "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

